﻿Imports MySql.Data
Imports MySql.Data.MySqlClient
Public Class Class1
    Dim con As MySqlConnection
    Public connectSrting As String = "server=localhost;user=root;database=vdoshop;port=3306;password=1234;"

    Public Function PopulateList(ByVal strSelect As String) As DataSet
        con = New MySqlConnection(connectSrting)
        Dim stmt As New MySqlCommand() ''or  Dim stmt As New MySqlCommand(query1, con)
        'query a query1
        stmt.Connection = con
        stmt.CommandText = strSelect
        stmt.CommandType = CommandType.Text
        Dim adapter As New MySqlDataAdapter(stmt)
        Dim ds As New DataSet()
        adapter.Fill(ds, "Categories")
        Return ds
    End Function
End Class
